﻿using MediatR;
using SheepStorage.API.Application.Command.SheepHybridizationCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.DTO.Output;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepHybridizationCommandHandler
{
    public class SheepHybridizationShowCommandHandler : IRequestHandler<SheepHybridizationShowCommand, Results<List<SheepMomHybridizationOutput>>>
    {
        ISheepHybridizationService _res;

        public SheepHybridizationShowCommandHandler(ISheepHybridizationService res)
        {
            _res = res;
        }

        public async Task<Results<List<SheepMomHybridizationOutput>>> Handle(SheepHybridizationShowCommand request, CancellationToken cancellationToken)
        {
            var list = await _res.ShowHybridization(request.input);
            return Results<List<SheepMomHybridizationOutput>>.DataResult(list);
        }
    }
}
